package com.fc.mall.controller;

import com.fc.mall.base.object.Result;
import com.fc.mall.model.SmsIntegrationSetting;
import com.fc.mall.model.UmsIntegrationConsumeSetting;
import com.fc.mall.service.SmsIntegrationSettingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * Created by sunny on 2019/10/14.
 */
@RestController
@RequestMapping("/sms/integration")
public class SmsIntegrationSettingController {

    @Autowired
    private SmsIntegrationSettingService integrationSettingService;

    @GetMapping("setting")
    public Result handleGetIntegrationSetting()
    {
        return Result.success(integrationSettingService.getIntegerSetting());
    }

    @PutMapping("setting")
    public Result handlePutIntegrationSetting(@RequestBody SmsIntegrationSetting integrationSetting)
    {
        return Result.success(integrationSettingService.updateIntegrationSetting(integrationSetting));
    }

    @GetMapping("consume/setting")
    public Result handleGetIntegrationConsumeSetting()
    {
        return Result.success(integrationSettingService.getIntegerConsumeSetting());
    }

    @PutMapping("consume/setting")
    public Result handleUpdateIntegrationConsumeSetting(@RequestBody UmsIntegrationConsumeSetting integrationConsumeSetting)
    {
        return Result.success(integrationSettingService.updateIntegrationConsumeSetting(integrationConsumeSetting));
    }


}
